<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			div{
				width: 300px;
				height: 100px;
				line-height:100px;
				text-align:center;
				background-color:purple;
				color:white;
			}
			img{
				width: 300px;
				height: 600px;
			}
		</style>
	</head>
	<body>
		<div id="div1">把鼠标移过来</div>
		<img src="img/1.webp" id="img1" alt="" />
		<script>
			div1.addEventListener('mouseover',function(){
				this.innerHTML="谢谢！";
				this.style.background="pink";
			})
			div1.addEventListener('mouseout',function(){
				this.innerHTML="把鼠标移过来";
				this.style.background="purple";
			})
			img1.addEventListener('mouseover',function(){
				this.src = "img/2.webp";
				
			})
			img1.addEventListener('mouseout',function(){
				this.src = "img/1.webp";
				
			})
		</script>
	</body>
</html>